<template>
	<view class="page-warpper">
		<view class="content-warpper">
			<baseForm :formConfig="formConfig" @submit="submit"></baseForm>
		</view>
	</view>
</template>

<script>
	import userMixins from '@/libs/userMixins.js'
	import gloryMixins from './gloryMixins.js';
	import baseForm from '@/components/dd-form/baseForm.vue';
	export default {
		mixins: [userMixins, gloryMixins],
		components: {baseForm},
		data() {
			return {
				// 新增申请接口
				applyUrl: '/stu/studentSkillsCertificate/save',
				info: {},
				formConfig: {
					type: 'apply',
					props: [
						{
							label: '名称',
							prop: 'certificateName',
							type: 'normal-input',
							inputType: 'textarea',
							border: true,
							height: 100,
							autoHeight: true,
						},
						{
							label: '颁发单位',
							prop: 'certificateIssuingAuthority',
							type: 'normal-input'
						},
						{
							label: '日期',
							prop: 'certificateDate',
							type: 'calendar-input',
							calendarMode: 'date',
							valueKey: 'value'
						},
						{
							label: '附件',
							prop: 'fj',
							type: 'upload-input'
						},
					],
					model: {
						certificateName: '',
						certificateIssuingAuthority: '',
						certificateDate: '',
						fileList: []
					},
				}
			}
		},
		methods: {
			async submit(model) {
				this.toReqModel(model, (reqModel) => {
					let params = {
						studentNumber: this.user.number,
						...reqModel
					}
					this.submitApply(params);
				})
			}
		},
	}
</script>

<style lang="scss" scoped>
.page-warpper {
	height: 100%;
}
.content-warpper {
	padding: 40rpx;
	height: calc(100% - 90rpx);
	overflow-y: auto;
}
	
</style>
